add_library(sum "")

target_sources(sum 
PRIVATE
 sum.cpp
PUBLIC 
 ${CMAKE_CURRENT_LIST_DIR}/sum.hpp
 )
 target_include_directories(sum
 PUBLIC
  ${CMAKE_CURRENT_LIST_DIR}
 )

 add_executable(main main.cpp)

 target_link_libraries(main
 PRIVATE
  sum
  )